home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- T_PX="`cat $TMP/SeTT_PX`"
- TMP=/var/log/setup/tmp
- export TEXTDOMAIN=SeTinitrd
- sata_mod=""
- SATA=""
- SCSI=""
-
- FS=`cat $TMP/ROOTFS 2>/dev/null`
-
- if [ "$FS" = "ext3" ] ; then
- ROOTFS="--preload=jbd --with=ext3"
- fi
-
- if [ "$FS" = "reiserfs" ] ; then
- ROOTFS="--with=reiserfs"
- fi
-
- if [ "$FS" = "xfs" ] ; then
- ROOTFS="--preload=exportfs --with=xfs"
- fi
-
- if [ "$FS" = "jfs" ] ; then
- ROOTFS="--with=jfs"
- fi
-
- if [ "$FS" = "reiser4" ] ; then
- ROOTFS="--with=reiser4"
- fi
-
-
-
- dialog --title "`gettext "INITRD setup"`" --no-cancel --menu \
- "`gettext "Now we must setup Initrd image. Initrd is needed to boot your new KateOS \
- system. 'simple' mode will configure initrd automatically, use this option, \
- if you've installed KateOS on IDE or SATA disk. Use 'expert' mode if you \
- are using SCSI disk, or if you need to add extra kernel modules to the initrd."`" 0 0 0 \
- "`gettext "simple"`" "`gettext "Configure initrd image automatically"`" \
- "`gettext "expert"`" "`gettext "Manual initrd setup"`" 2>$TMP/reply
-
- REPLY="`cat $TMP/reply`"
- rm -f $TMP/reply
-
- if [ "$REPLY" = "`gettext "simple"`" ] ; then
-
- if cat /proc/cmdline | grep sata 1>/dev/null ; then
- SATA=" --preload=libata --preload=sd_mod --with=sata_sil --with=sata_sil24 --with=sata_nv --with=sata_mv --with=sata_qstor --with=sata_promise --with=sata_sis --with=sata_svw --with=sata_sx4 --with=sata_uli --with=sata_via --with=ata_piix"
- fi
-
- if cat /proc/cmdline | grep scsi 1>/dev/null ; then
- SCSI=" --preload=libata --preload=sd_mod --with=aic7xxx --with=in2000 --with=aha1542 --with=ahci --with=dc395x --with=dtc --with=g_NCR5380 --with=initio --with-nsp32 --with=pas16 --with=sg --with=ultrastor --with=3w-xxxx"
- fi
-
- if cat /mnt/etc/fstab | grep /dev/hd 1>/dev/null ; then
- IDE="--with=ide-disk"
- fi
-
-
- dialog --title "`gettext "Please wait"`" --infobox "`gettext "Making an initrd image, this can take a while... \
- You must use this initrd to boot the system, remember to add it into your boot loader configuration file."`" 6 65
-
- if [ -f /mnt/boot/initrd ] ; then
-
- rm -f /mnt/boot/initrd.old
- mv /mnt/boot/initrd /mnt/boot/initrd.old
-
- fi
-
- INITRDNAME=initrd
-
-
- if [ ! -f /mnt/sbin/mkinitrd ] ; then
- dialog --title "`gettext "Error"`" --msgbox "`gettext "No mkinitrd command found. Perhaps you should install 'pkgtools' package ;)"`" 6 60
- exit 1
- else
- chroot /mnt mount proc -t proc /proc &>/dev/null
- chroot /mnt mount sys -t sysfs /sys &>/dev/null
- chroot /mnt mkinitrd $SATA $SCSI $IDE $ROOTFS --splash=1024x768 /boot/initrd `uname -r` 2>/dev/null
- chroot /mnt umount /proc &>/dev/null
- chroot /mnt umount /sys &>/dev/null
- fi
-
- fi
-
-
- if [ "$REPLY" = "`gettext "expert"`" ] ; then
-
- dialog --title "`gettext "INITRD Setup"`" --inputbox \
- "`gettext -e "Here you can type parameters to mkinitrd. If you are using scsi devices, you must \
- add here required driver modules. Provided options: \n \n \
- '--preload=MODULE' Load the module MODULE before any SCSI modules. This option \
- may be used as many times as necessary. \n \n \
- '--with=MODULE' Load module MODULE after any SCSI modules. This option \
- may be used as many times as necessary. \n \n \
- '--nocompress' Skip compression of the initrd image. \n \n \
- eg. '--with=sata_sil --with=ide-cd' \n"` \
- " 20 72 2> $TMP/reply
-
- OPTIONS=`cat $TMP/reply`
-
- dialog --title "`gettext "Please wait"`" --infobox "`gettext "Making an initrd image, this can take a while... \
- You must use this initrd to boot the system, remember to add it into your boot loader configuration file."`" 6 65
-
- if [ -f /mnt/boot/initrd ] ; then
-
- rm -f /mnt/boot/initrd.old
- mv /mnt/boot/initrd /mnt/boot/initrd.old
-
- fi
-
- INITRDNAME=initrd
-
-
- if [ ! -f /mnt/sbin/mkinitrd ] ; then
- dialog --title "`gettext "Error"`" --msgbox "`gettext "No mkinitrd command found. Perhaps you should install 'pkgtools' package ;)"`" 6 60
- exit 1
- else
- chroot /mnt mount proc -t proc /proc &>/dev/null
- chroot /mnt mount sys -t sysfs /sys &>/dev/null
- chroot /mnt mkinitrd $OPTIONS $ROOTFS /boot/initrd `uname -r` 2>/dev/null
- chroot /mnt umount /proc &>/dev/null
- chroot /mnt umount /sys &>/dev/null
- fi
-
- fi